#pragma config(Sensor, dgtl1,  LimitArmTwo,         sensorTouch)
#pragma config(Sensor, dgtl2,  LimitArmOne,         sensorTouch)
#pragma config(Motor,  port1,           LeftBase,      tmotorNormal, openLoop, reversed)
#pragma config(Motor,  port4,           LeftArm,       tmotorNormal, openLoop, reversed)
#pragma config(Motor,  port5,           RightArm,      tmotorNormal, openLoop)
#pragma config(Motor,  port6,           LeftVacume,    tmotorNormal, openLoop, reversed)
#pragma config(Motor,  port7,           RightVacume,   tmotorNormal, openLoop)
#pragma config(Motor,  port8,           LeftTurntable, tmotorNormal, openLoop)
#pragma config(Motor,  port9,           RightTurntable, tmotorNormal, openLoop)
#pragma config(Motor,  port10,          RightBase,     tmotorNormal, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

///////////////////////////////Start Remote Control Voids/////////////////////////////
void TurntableForward()
{
  if(vexRT[Btn6UXmtr2] == 1)
  {
    motor[LeftTurntable] = 127;
    motor[RightTurntable] = 127;
  }
  else
  {
    motor[LeftTurntable] = 5;
    motor[RightTurntable] = 5;
  }
}

void TurntableBackward()
{
  if(vexRT[Btn6DXmtr2] == 1)
  {
    motor[LeftTurntable] = -127;
    motor[RightTurntable] = -127;
  }
}

void Base()
{
  motor(LeftBase) = vexRT(Ch1);
  motor(RightBase) = vexRT(Ch3);
}

void ArmsUp()
{
  if(vexRT[Btn7UXmtr2] == 1) // makes the arms go up if Btn 7 Up is pressed
  {
    motor[LeftArm] = 127;
    motor[RightArm] = 127;
  }
  else
  {
    motor[LeftArm] = 0;
    motor[RightArm] = 0;
  }
}

void ArmsDown()
{
  if(vexRT[Btn7DXmtr2] == 1 && SensorValue(LimitArmOne) == 0)  // makes the arms go down if Btn 7 Down is pressed
  {
    motor[LeftArm] = -127;
  }
  if(vexRT[Btn7DXmtr2] == 1 && SensorValue(LimitArmTwo) == 0)
  {
    motor[RightArm] = -127;
  }
}
void VacumeUp()
{
  if(vexRT[Btn8UXmtr2] == 1) // makes the vacume go up if Btn 8 up is pressed
  {
    motor[LeftVacume] = 127;
    motor[RightVacume] = 127;
  }
  else
  {
    motor[LeftVacume] = 0;
    motor[RightVacume] = 0;
  }
}

void VacumeDown()
{
  if(vexRT[Btn8DXmtr2] == 1) // makes the vacume go down if Btn 8 down is pressed
  {
    motor[LeftVacume] = -127;
    motor[RightVacume] = -127;
  }
}
/////////////////////////////////End Remote Control Voids///////////////////////////////
task main()
{
  while(1) // the code goes forever
  {
    TurntableForward(); // second remote
    TurntableBackward(); // second remote
    Base();
    ArmsUp(); // second remote
    ArmsDown(); // second remote
    VacumeUp(); // second remote
    VacumeDown(); // second remote
  }
}
